<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <input type="text" @keyup="showKey"><br>
        <input type="text" placeholder="按下CapsLock输出" @keyup.caps-lock="showKey"><br>

        <input type="text" placeholder="按下ctrl+y输出" @keyup.ctrl.y="showKey"><br>

        <input type="text" placeholder="按下tab输出" @keydown.tab="showKey"><br>
    </div>


    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el: '#root',
            methods: {
                showKey(e){
                    console.log(e.key, e.keyCode)
                }
            }
        })
        console.log(vm)
    </script>

</body>
</html>